package cn.edu.scnu.entry.dao;

import cn.edu.scnu.entry.model.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface RegisterMapper {
    //@Options(useGeneratedKeys = true, keyProperty = "id")
    //删除了role
    @Insert("insert into users(username,password,email) values(#{username},#{password},#{email})")
    void register(User user);
    @Select("select id,username,role from users where username=#{username}")
    User findByUsername(String username);
    @Select("select id,username,role from users where username=#{username} and password=#{password}")
    User login(User user);
}
